﻿using Microsoft.Extensions.DependencyInjection;
using Poplar.Passport.IRepositories;
using Poplar.Passport.IServices;
using Poplar.Passport.Repositories;
using Poplar.Passport.Services;

namespace Poplar.Passport.Injection
{
    public static class PassportInjectionExtension
    {
        public static void AddPassport(this IServiceCollection service)
        {
            AddService(service);

            AddRepositories(service);
        }

        private static void AddService(IServiceCollection service)
        {
            service.AddTransient<IUserService, UserService>();
        }

        private static void AddRepositories(IServiceCollection service)
        {
            service.AddTransient<IUserRepository, UserRepository>();
        }
    }
}
